from flask import Flask
from flask_socketio import SocketIO
from config import Config

app = Flask(__name__, 
           static_folder='../static', 
           template_folder='../templates')
app.config.from_object(Config)

# 初始化SocketIO
socketio = SocketIO(app, cors_allowed_origins="*")

from app import routes, mqtt_client

# 启动模拟数据生成
mqtt_client.generate_mock_data()